<?php
	$id = $_GET['id'];
	
	if ( preg_match('/\d/', $id) ) 
	{
		$eeRO_base_eeRO->query('SELECT `news_id`, `news_title` FROM `eeRO_news` WHERE `news_id`=:id', array(':id' => $id));
		$news = $eeRO_base_eeRO->fetch();
		
		if ( $eeRO_base_eeRO->num() > 0 )
		{
			$chk = intval($_GET['chk']);
			
			if ( $chk === 1 )
			{
				$eeRO_base_eeRO->query('DELETE FROM `eeRO_news` WHERE `eeRO_news`.`news_id` = :news_id', array(':news_id' => $id));
				$eeRO_view->assign('module', array('title' => 'Удалить новость', 'template' => 'news_del_yes.html'));
			}
			else
			{
				$eeRO_view->assign('module', array('title' => 'Удалить новость', 'template' => 'news_del.html', 'news' => $news));
			}
		}
		else
		{
			$eeRO_view->assign('module', array('template' => 'bootstrap_404.html'));
		}
	}
	else
	{
		$eeRO_view->assign('module', array('template' => 'bootstrap_404.html'));
	}